Securing accessible systems using cross-linking

ABSTRACT

Systems and techniques for securing accessible computer-executable program code and systems are provided. One or more base functions may be generated and blended with existing program code, such that it may be difficult or impossible for a potential attacker to distinguish the base functions from the existing code. The systems and code also may be protected using a variety of other blending and protection techniques, such as fractures, variable dependent coding, dynamic data mangling, and cross-linking, which may be used individually or in combination, and/or may be blended with the base functions.

TECHNICAL FIELD

The present invention relates generally to electronic computing devicesand computer systems, and more specifically, to securing software andfirmware on devices and systems which are accessible to attack.

BACKGROUND

The use of computers, electronic computing devices and computer softwarein all of their various forms is recognized to be very common and isgrowing every day. As well, with the pervasiveness of powerfulcommunication networks, the case with which computer software programsand data files may be accessed, exchanged, copied and distributed isalso growing daily. In order to take advantage of these computer andcommunication systems and the efficiencies that they offer, there is aneed for a method of storing and exchanging computer software and datasecurely.

One method of maintaining confidentiality or privacy that hasdemonstrated widespread use and acceptance is encryption of data usingsecret cryptographic keys. Existing encryption systems are designed toprotect their secret keys or other secret data against a “black boxattack”. This is a situation where an attacker has knowledge of thealgorithm and may examine various inputs to and outputs from thealgorithm, but has no visibility into the execution of the algorithmitself (such as an adaptive chosen input/output attack).

While cryptographic systems relying on the black box model are verycommon, it has been shown that this model does not reflect reality.Often, the attacker is in a position to observe at least some aspect ofthe execution of the algorithm, and has sufficient access to thetargeted algorithm to mount a successful attack (i.e. side-channelattacks such as timing analysis, power analysis, cache attacks, faultinjection, etc.) Such attacks are often referred to as “grey-box”attacks, the assumption being that the attacker is able to observe atleast part of the system execution.

Recognizing this, an effort has been made to design encryptionalgorithms and data channels which are resistant to a more powerfulattack model—the “white box attack”. A white box attack is an attack ona software algorithm in which it is assumed that the attacker has fullvisibility into the execution of the algorithm. To date, such protectionsystems have met with reasonable success, but as such protection systemshave become more and more sophisticated, so has the sophistication ofthe attacking techniques (such as encoding reduction attacks,statistical bucketing attacks and homomorphic mapping attacks). Thus,many existing white box protection systems are being shown to beineffective against concerted attacks.

Obfuscation of software by means of simple encodings has been in use forsome time. In order to be useful, applications of such encodings insoftware obfuscation must not increase the time and space consumption ofthe software unduly, so such encodings are typically relatively simple.Hence, while they can protect software in bulk, they do not provide ahigh degree of security. There are many communication boundaries insoftware which represent particular vulnerabilities: passage of data inunprotected form into or out of an obfuscated program, passage of datainto or out of a cipher implementation in software or hardware, and thelike. The strength of prior encoding strategies typically is sharplylimited by the data sizes which they protect. For conventionalencodings, such protected items are on the order of 32 bits, sometimes64 bits, and sometimes smaller pieces of data such as characters orbytes. Given the limitations of encodings and the operand sizes, fairlyswift brute-force cracking of such encodings cannot be prevented ingeneral.

There is therefore a need for more effective secret-hiding andtamper-resistance techniques, providing protection of software code anddata in general, as well as protection of secret cryptographic keys,biometric data, encrypted data and the like. It also is desirable toprovide a much stronger form of protection for software boundaries thanconventional simple encodings.

SUMMARY

Embodiments of the present invention aim generally at providing moreeffective secret-hiding and tamper-resistance techniques, providingprotection of software code and data without fear that security will bebreached.

The methods and systems disclosed herein are not limited to anyparticular underlying program. They may be applied to cryptographicsystems, but equally, may be applied to non-cryptographic systems. Aswell, the software code that is being protected does not dictate what isdone to protect it, so the protection techniques are not constrained bythe underlying code. This may provide an advantage over other protectiontechniques which can leave or create patterns that are based on theunderlying code. Such patterns may provide weaknesses that can beexploited by attackers.

Some embodiments disclosed herein provide “profound data dependence”,which can make it difficult or impossible to unentangle or distinguishthe protected code and the code which is providing protection. Forexample, AES algorithms typically execute the same way all the time, nomatter what the input data is. This makes it straightforward for anattacker to know what he is looking for and where to find it. Most whitebox protection systems have a rigid equation structure which does notaddress this type of problem. That is, an attacker may know what typesof operations or effects to look for, and where in code or execution tolook to find those operations or effects. In contrast, embodimentsdisclosed herein may provide coding which is not rigid, such as whereeach iteration of a protection algorithm results in a differentencoding. Thus, the system is extremely non-repeatable. Among otherthings, this may make embodiments disclosed herein more resistant to a“compare” type attack, in which an attacker changes 1 bit and observeshow the targeted program changes. In some embodiments disclosed herein,if an attacker changes 1 bit, then the protected code will lookcompletely different.

As a matter of overview, the embodiments of tools, families of tools,and techniques described herein may generally be grouped as follows:

1) Systems and techniques for blurring boundaries between modules oftargeted code, and between the targeted code and the protection code.This may be accomplished, for example, by blending code together withsurrounding code, and interleaving ciphers with other code, which isusually not done in other protective systems.2) Systems and techniques for ensuring that a crack requires humanintervention. Humans look for patterns that they have seen before. Byintroducing random functions according to embodiments disclosed herein,repetitive and/or common patterns can be removed so that automatedattacks are largely ineffective.3) Systems and techniques for protecting against “compare attacks”. Asnoted above, a compare attack is an attack where two iterations of codeexecution are compared to see the difference, such as changing a singleinput bit to see how the operation and output change. Protectionalgorithms as disclosed herein may result in dramatically differentfunctions with each iteration of the protected code, so a compare attackdoes not provide any useful information.

The obfuscation techniques described herein may be implemented whereverthe overhead can be accommodated. White box protection systems typicallyhave larger overheads than the techniques described herein, and aretherefore at a disadvantage.

Some embodiments include systems and techniques for software protectionthat operate by applying bijective “base” functions to the targetedcode. These base functions are pairs of mutually-inverse functionsθ_(K), ƒ_(K) ⁻¹ which are used, for example, to encode an operation, andthen un-encode the operation at a later point in a software application.The encoding obscures the original function and the data which itgenerates. There is no loss of information, as the unencoding operationaccommodates for the encoding operation, “undoing” or “reversing” itseffect later in the encoded application. Base function pairs may bechosen such that an attacker cannot easily find or determine the inversefunction. That is, given a function ƒ_(K), the inverse ƒ_(K) ⁻¹ may notbe found easily without the key K. The key K may be used at codegeneration time, but then discarded once the functions ƒ_(K), ƒ_(K) ⁻¹have been generated and applied to the targeted code. These basefunction pairs are also lossless, i.e. mathematically invertible. Theprotected software application does not need to decode a function orprocess completely to use it elsewhere in the targeted code, as theencoding and unencoding changes are included within the encodedapplication. In some embodiments it may be preferred that the basefunctions are “deeply non-linear”, thus making homomorphic attacks moredifficult. In some embodiments, base function pairs may includepermutation polynomial encodings. A permutation polynomial is apolynomial which is invertible (a polynomial bijection).

Some embodiments may generate or use base function pairs in such amanner that they generate “instance diversity” and “dynamic diversity”.To achieve “instance diversity”, each base function pair may create asecure “communication channel”, such as between portions of a softwareapplication, between two software applications or platforms, or thelike. Dynamic diversity may be created by linking operation of thesoftware to the input data. Each time an encoding is performed, such asfor communication between two encoded applications, instance and dynamicdiversity may be generated between the two applications. The basefunctions may be highly “text dependent” so they offer good resistanceto plaintext and perturbation attacks. If an attacker changes anything,even making a very small change such as the value of 1 bit, the changewill result in a very large behavioural change. This feature is asignificant contrast to conventional cipher code, which typicallyresults in the same patterns and structure with each iteration of thecode, regardless of the changes that an attacker makes. By making smallchanges and observing the impact, the attacker is able to gatherinformation about the operation of cipher code, but he is not able to dothe same with software encoded using systems and techniques disclosedherein. The diversity provided by embodiments disclosed herein alsoprovides resistance to a “class crack”. That is, it is not possible toprovide an attack methodology which can systematically and automaticallycrack each embodiment of the invention in all cases. Note also, thatconventional white box implementations and code optimizers will notprovide sufficient diversity to gain any effective protection.

The diversity and non-invertibility of the inventive base functionsincrease the complexity of the attack problem immensely. In contrast toconventional software code or code protection systems, when attemptingto defeat the systems and techniques disclosed herein, an attacker mustfirst figure out what function, code portion, application, or the likehe is attacking, then how to invert it, and then how to exploit it.

The diversity provided by embodiments disclosed herein may provide avariable, randomly-chosen structure to protected code. An engine whichgenerates the base function pairs and encodings may rely on a random orpseudo-random key to choose the underlying function and/or the key.However, a key according to embodiments disclosed herein may not be assmall as the keys of many conventional security systems (i.e. 64 or 128bits); rather, it may be thousands or tens of thousands of bits. Forexample, a prototype was developed which uses 2,000 bits.

The base functions disclosed herein may include bijections used toencode, decode, or recode data. Such bijections may include thefollowing characteristics:

1) Encoding wide data elements (typically four or more host computerwords wide), unlike typical scalar encodings (see [5, 7] listed in theAppendix), but like block ciphers.

2) Encoding data only: unlike typical scalar encodings, but likeciphers, they are not required to protect computations other than thoseinvolved in their own recoding of data elements.

3) Concealing blocks or streams of data, and/or producing fixed-lengthhashes of blocks or streams of data for authentication purposes, similarto block ciphers, but unlike scalar encodings.

4) Employing forms of operations purposely chosen from the operationrepertoire of the software in which they will reside and with which theywill be interlocked; i.e., they are designed to resemble the code in thecontext of which they are embedded, unlike ciphers.

5) Unlike both ciphers and scalar encodings, employing massivemulticoding. A scalar encoding generally employs one or at most a fewmathematical constructions. A cipher typically employs a slightly largernumber, but the number is still small. In some embodiments of theinvention, a variety of encodings are applied to an entire function,creating an intricately interlaced structure resulting from theinteraction of many forms of protection with one another.

6) Unlike both ciphers and scalar encodings providing massively diversealgorithmic architecture. Embodiments may have no fixed number ofrounds, no fixed widths for operands of various substeps, no fixedinterconnection of the various substeps, and no predetermined number ofiterations of any kind.

7) Unlike both ciphers and scalar encodings, providing massive dynamicdiversity by means of highly data-dependent algorithms: i.e., for anyparticular employment of a base function bijection, the path through itssubsteps, its iteration counts, and the like, depend intensely on theactual data input to be encoded, decoded, or recoded.

8) Unlike both ciphers and scalar encodings, providing massiveinterdependence with their embedding context; i.e., their behavior maydepend strongly on the software in which they are embedded, and thesoftware in which they are embedded can be made to depend strongly onthem.

Some embodiments may use a large quantity of real entropy (i.e., a largetruly random input). However, if an engine which generates the basefunction pairs is not itself exposed to attackers, it may be safe toemploy significantly smaller keys which then generate much largerpseudo-random keys by means of a pseudo-random number generator, sincein that case, the attacker must contend with both the real key entropy(that for the seed to the pseudo-random number generator) and therandomness inevitably resulting from the programming of the generator.

In some embodiments, biased permutations may also be used. If internaldata is used to generate base function pairs or other encodingdata/functions rather than random numbers, then the resulting encodingwill contain bias. If code is introduced to create unbiased permutationsthat coding may be readily apparent, resulting in a weakness in thesystem. In contrast, embodiments disclosed herein may generate biasedpermutations, but then use various tools to make them less biased. Thisapproach has been shown to be much less apparent than known techniques.

Some embodiments may include techniques for binding pipe-starts andpipe-ends, so that the targeted software code is tied to applications orplatforms at both ends. This may be useful, for example, in apeer-to-peer data transfer environment or a digital rights management(DRM) environment. Systems and techniques disclosed herein also may beused to tie ciphers to other software applications or platforms, whichis generally difficult to do using conventional techniques.

Some embodiments may use “function-indexed interleaving”. This techniqueprovides deep nonlinearity from linear components, and nonlinearequation solving. It can be used in many ways, such as boundaryprotection, dynamic constant generation (e.g. key-to-code), providingdynamic diversity (data-dependent functionality), self-combiningciphers, cipher mixing and combining ciphers and non-ciphers. Forexample, it may be used to mix black box ciphers with the otherprotection code disclosed herein, providing the long term security of ablack box cipher, with the other benefits of white box security. Asnoted above, the encoding of the embodiments disclosed herein may behighly dependent on run-time data. With function index interleaving, twokinds of information are used: a key, K, which determines the basefunctions and structure, and R, which determines which obfuscations areto be applied to the “defining implementations”. Typically the clientdoes not see R. The key, K, may be augmented from the context, though insome examples described herein, only R is augmented in this way.Optionally, semi-consistent information or data from a user or hisdevice (such as a smart phone, tablet computer, PDA, server or desktopcomputer system, or the like) such as an IP address, could be used toencode and decode as a runtime key.

Recursive function-indexed interleaving also may be used.Function-indexed interleaving typically interleaves arbitrary functions.If some of these functions are themselves functions obtained byfunction-indexed interleaving, then that is a recursive use offunction-indexed interleaving.

Some embodiments may include random cross-linking, cross-trapping,dataflow duplication, random cross-connection, and random checks,combined with code-reordering, create omni-directionalcross-dependencies and variable-dependent coding.

Some embodiments may use memory-shuffling with fractured transforms(dynamic data mangling) to hide dataflow may also be employed. Indynamic data mangling, an array A of memory cells may be used which canbe viewed as having virtual indices 0, 1, 2, . . . , M−1 where M is thesize of the array and the modulus of a permutation polynomial p on thefinite ring Z/(M) (i.e., the integers modulo M), as in a C programarray. However, for any given index i, there is no fixed position in thearray to which it corresponds, since it is addressed as p(i), and pemploys coefficients determined from the inputs to the program. Thelocations A[p(0)], A[_(P)(1)], . . . , A[p(M−1)] may be considered“pseudo-registers” R₁, . . . , R_(M-1) extending those of the hostmachine. By moving data in and out of these registers, recoding themoved data at every move, and by re-using these “pseudo-registers” formany different values (e.g., by employing graph-coloring registerallocation), the difficulty for an attacker to follow the data-flow ofthe program may be greatly increased.

Some embodiments may use “spread and blend” encoding. This is anotherway of describing the use of base functions plus code interleaving,which “smears out” the boundaries of the base functions to make themmore difficult for an attacker to discern. General data blending mayhave portions of base functions that are mixed with other code, makingit more difficult to identify and lift the code.

Some embodiments provide security lifecycle management. Black boxsecurity provides good long-term protection, but is not very useful intoday's applications. Embodiments disclosed herein may refreshimplementations faster than they can be cracked on unprotected devices.Different devices and applications have different needs. For example, apay-per-view television broadcast such as a sporting event, may havevery little value several days after the event, so it may only benecessary to provide sufficient security to protect the broadcast datafor a day or so. Similarly, the market for computer games may tail offvery quickly after several weeks, so it may be critical only to protectthe game for the first few weeks or months. Embodiments disclosed hereinmay allow a user to apply the level of security that is required,trading off the security against performance. Literally, an adjustable“obfuscation dial” can be placed on the control console. Although thespecific defined level of security achieved may be unknown, theintensity with which obfuscating methods are applied may be controlled.Generally, these settings may be adjusted when the application iscreated with its embedded base function, as part of a softwaredevelopment process. Security analysis may provide an estimate of howdifficult the application will be to crack given a specific level ofobfuscation. Based on the estimate, an engineering decision may be madeof how to balance performance needs against the need for security, and“obfuscation dial” may be set accordingly. This kind of flexibility isnot available with other protection systems. With AES, for example, afixed key length and fixed code is used, which cannot be adjusted.

Some embodiments may provide a flexible security refresh rate, allowingfor a trade-off of complexity for the “moving target” of refreshingcode. In many cases, the need is to refresh fast enough to stay ahead ofpotential attackers.

Some embodiments may not have a primary aim of providing long-term datasecurity in hacker-exposed environments. For that, the solution is notto expose the data to hackers, but only to expose means of access to thedata by, e.g., providing a web presence for credential-protected(SecureID™, pass-phrases, etc.) clients which access the data viaprotected conversations which can expose, at most, a small portion ofthe data. In a hacker-exposed environment, it may be expected that aprocess of refreshing the exposed software in some fashion will bedeployed. For example, in satellite TV conditional access systems,cryptographic keys embedded in the software in the set-top boxes (STBs)are refreshed on a regular basis, so that any compromise of the keys hasvalue for only a limited period of time. Currently, such cryptographickeys may be protected over this limited exposure period by means ofsoftware obfuscation and/or white-box cryptography.

However, white-box cryptography has proven to be vulnerable to attackswhich can be executed very swiftly by cryptographically-sophisticatedattackers with expert knowledge of the analysis of executable programs,since the cryptographic algorithms employed are amongst the mostthoroughly examined algorithms in existence, and the tools for analysingprograms have become very sophisticated of late as well. Moreover,ciphers have peculiar computational properties in that they are oftendefined over arithmetic domains not normally used in computation: forexample, AES is defined over a Galois field, RSA public-keycryptosystems are defined by modular arithmetic over extremely largemoduli, 3DES over bit operations, table lookups, and bit-permutationsextended with duplicated bits.

In fact, the sophisticated analysis of programs has created a method ofattack which sometimes can bypass the need for cryptanalysis altogether:the code-lifting attack, whereby the attacker simply extracts thecryptographic algorithm and employs it with no further analysis (sinceit is, after all, an operational piece of software, however obfuscatedit may be) to crack a software application's functionality.

Some embodiments may provide much stronger short-term resistance toattack. Such protection may be suitable for systems where the time overwhich resistance is needed is relatively short, because longer termsecurity is addressed by means of refreshing the software which resideson the exposed platforms. This addresses a specific unfilled need whichfocuses at the point of tension created by highly sophisticatedcryptanalytic tools and knowledge, extremely well studied ciphers,limited protections affordable via software obfuscation, highlysophisticated tools for the analysis of executable programs, and thelimited exposure times for software in typical commercial contentdistribution environments. The goal is to prevent the kinds of attackswhich experience with white-box cryptography has shown to be within thestate of the art: swift cryptanalytic attacks and/or code-liftingattacks so swift that they have value even given the limited lifespansof validity between refreshes of the exposed programs (such as STBprograms).

In many cases, it is only necessary to resist analysis for the durationof a refresh cycle, and to tie cipher-replacement so tightly to theapplication in which it resides that code-lifting attacks are alsoinfeasible for the duration of a refresh cycle. The refresh cycle rateis determined by engineering and cost considerations: how much bandwidthcan be allocated to refreshes, how smoothly we can integrate refresheswith ongoing service without loss of quality-of-service, and so on:these are all problems very well understood in the art of providingconditional access systems. These considerations indicate roughly howlong our protections must stand up to analytic and lifting attacks.

Some embodiments may provide significantly larger encodings which canresist attacks for longer periods of time, by abandoning the notion ofcomputing with encoded operands—as is done with the simpler encodingsabove—and replacing it with something more like a cipher. Ciphersthemselves can be, and are, used for this purpose, but often they cannoteasily be interlocked with ordinary software because (1) theiralgorithms are rigidly fixed by cipher standards, and (2) theircomputations are typically very different from ordinary software andtherefore are neither readily concealed within it, nor readilyinterlocked with it. The base-functions described herein provide analternative which permits concealment and interlocking: they make use ofconventional operations, and their algorithms are enormously moreflexible than is the case with ciphers. They can be combined withciphers to combine a level of black-box security as strong asconventional cryptography with a level of white-box securitysignificantly superior to both simple encodings as above and knownwhite-box cryptography.

In some embodiments, a base function may be created by selecting a wordsize w and a vector length N, and generating an invertible state-vectorfunction configured to operate on an N-vector of w-element words, whichincludes a combination of multiple invertible operations. Thestate-vector function may receive an input of at least 64 bits andprovides an output of at least 64 bits. A first portion of steps in thestate-vector function may perform linear or affine computations overZ/(2^(w)). Portions of steps in the state-vector function may be indexedusing first and second indexing techniques. At least one operation in anexisting computer program may then be modified to execute thestate-vector function instead of the selected operation. Each of theindexing techniques may control a different indexing operation, such asif-then-else constructs, switches, element-permutation selections,iteration counts, element rotation counts, function-indexed key indexes,or the like. Some of the steps in the state-vector function may benon-T-function operations. Generally, each step in the state-vectorfunction may be invertible, such that the entire state-vector functionis invertible by inverting each step. In some configurations thestate-vector function may be keyed using, for example, a run-time key, ageneration-time key, or a function-indexed key. The state-vectorfunction may be implemented by various operation types, such as linearoperations, matrix operations, random swaps, or the like. Variousencoding schemes also may be applied to inputs and/or outputs of thestate-vector function, and/or operations within the state-vectorfunction. In some configurations, different encodings may be applied toas to produce fractures at various points associated with thestate-vector function.

In some embodiments, base functions as disclosed herein may be executedby, for example, receiving an input having a word size w, applying aninvertible state-vector function configured to operate on N-vectors ofw-element words to the input, where the state-vector function includesmultiple invertible operations, and a first portion of steps in thestate-vector function perform linear or affine computations overZ/(2^(w)). Additional operations may be applied to the output of theinvertible state-vector function, where each is selected based upon adifferent indexing technique. Generally, the state-vector function mayhave any of the properties disclosed herein with respect to thestate-vector function and base functions.

In some embodiments, a first operation may be executed by performing asecond operation, for example, by receiving an input X encoded as A(X)with a first encoding A, performing a first plurality ofcomputer-executable operations on the input using the value of B⁻¹(X),where B⁻¹ is the inverse of a second encoding mechanism B, the secondencoding B being different from the first encoding A, providing anoutput based upon B⁻¹(X). Such operation may be considered a “fracture”,and may allow for an operation to be performed without being accessibleor visible to an external user, or to a potential attacker. In someconfigurations, the output of the first operation may not be providedexternal to executable code with which the first operation isintegrated.

In some embodiments, for a matrix operation configured to receive aninput and provide an output, prior to performing the operation, theinput may be permuted according to a sorting-network topology. Thematrix operation may be executed using the permuted input to generatethe output, and the output permuted according to the sorting-networktopology. The permuted output then may be provided as the output of thematrix operation.

In some embodiments, a first input may be received, and afunction-indexed interleaved first function applied to the first inputto generate a first output having a left portion and a right portion. Afunction-index interleaved second function may be applied to the firstoutput to generate a second output, where the left portion of the firstoutput is used as a right input to the second function, and the rightportion of the first output is used as a left input to the secondfunction. The second output may then be provided as an encoding of thefirst input.

In some embodiments, a key K may be generated, and a pair of basefunctions ƒ_(K), ƒ_(K) ⁻¹ generated based upon the key K and arandomization information R. The base function ƒ_(K) may be applied to afirst end of a communication pipe, and the inverse ƒ_(K) ⁻¹ to a secondend of the communication pipe, after which the key K may be discarded.The communication pipe may span applications on a single platform, or onseparate platforms.

In some embodiments, one or more operations to be executed by a computersystem during execution of a program may be duplicated to create a firstcopy of the operation or operations. The program may then be modified toexecute the first operation copy instead of the first operation. Eachoperation and the corresponding copy may be encoded using a differentencoding. Pairs of operations also may be used to create a check value,such as where the difference between execution of an operation resultand execution of the copy is added to the result of the operation or theresult of the operation copy. This may allow for detection of amodification made by an attacker during execution of the program.

In some embodiments, during execution of a program that includesmultiple operations and a copy of each operation, upon reaching anexecution point at which an operation of the plurality of operationsshould be performed, either a copy or the original operation may beselected randomly and executed by the program. The result of therandomly-selected operations may be equivalent to a result that wouldhave been obtained had only a single copy of the operations beenperformed.

In some embodiments, an input may be received from an application. Anarray of size M may be defined with a number of M-register locations c₁,. . . , c_(n), with n≦M. A permutation polynomial p, an input-based 1×nvector mapping matrix A yielding z from the input, and a series ofconstants c_(i)=p(z+i) also may be defined. A series of operations maythen be performed, with each operation providing an intermediate resultthat is stored in an M-register selected randomly from the M-registers.A final result may then be provided to the application based upon theseries of intermediate results from a final M-register storing the finalresult. Each intermediate result stored in an M-register, may have aseparate encoding applied to the intermediate result prior to storingthe intermediate result in the corresponding M-register. The differentencodings applied to intermediate results may be randomly chosen fromamong multiple different encodings. Similarly, different decodings,which may or may not correspond to the encodings used to storeintermediate results in the M-registers, may be applied to intermediateresults stored in M-registers. New M-registers may be allocated asneeded, for example, only when required according to a graph-coloringallocation algorithm.

In some embodiments, a first operation g(y) that produces at least afirst value a as an output may be executed, and a first variable xencoded as aX+b, using a and a second value b. A second operationƒ(aX+b) may be executed using aX+b as an input, and a decoding operationusing a and b may be performed, after which a and b may be discarded.The value b also may be the output of a third operation h(z). Differentencodings may be used for multiple input values encoded as aX+b, usingdifferent execution instances of g(y) and/or h(z). The values may beselected from any values stored in a computer-readable memory, basedupon the expected time that the constant(s) are stored in the memory.Similarly, existing computer-readable program code containinginstructions to execute an operation ƒ(aX+b) and g(y), and g(y) producesat least a first value c when executed; may be modified to encode x ascX+d. The operation ƒ(cX+d) may be executed for at least one x, and cand d subsequently discarded.

In some embodiments, at least one base function may be blended withexecutable program code for an existing application. For example, thebase function may be blended with the executable program code byreplacing at least one operation in the existing program code with thebase function. The base function also may be blended with the existingapplication by applying one, some, or all of the techniques disclosedherein, including fractures, variable dependent coding, dynamic datamangling, and/or cross-linking. The base functions and/or any blendingtechniques used may include, or may exclusively include, operationswhich are similar or indistinguishable from the operations present inthe portion of the existing application program code with which they areblended. Thus, it may be difficult or impossible for an attacker todistinguish the base function and/or the blending technique operationsfrom those that would be present in the existing executable program codein the absence of the base function.

In some embodiments, a computer system and/or computer program productmay be provided that includes a processor and/or a computer-readablestorage medium storing instructions which cause the processor to performone or more of the techniques disclosed herein.

Moreover, because the algorithms used with base functions disclosedherein may be relatively flexible and open-ended, they permit highlyflexible schemes of software diversity, and the varied instances candiffer more deeply than is possible with white-box cryptography. Thus,they are far less vulnerable to automated attacks. Whenever attacks canbe forced to require human participation, it is highly advantageous,because we can new instances of protected code and data may beautomatically generated at computer speeds, but they can only becompromised at human speeds.

Other systems, methods, features and advantages of the invention willbe, or will become, apparent to one with skill in the art uponexamination of the following figures and detailed description. It isintended that all such additional systems, methods, features andadvantages be included within this description, be within the scope ofthe invention, and be protected by the following claims.

BRIEF DESCRIPTION OF THE DRAWINGS

In the appended drawings:

FIG. 1 shows a commutative diagram for an encrypted function, inaccordance with the present invention;

FIG. 2 shows a Virtual Machine General Instruction Format, in accordancewith the present invention;

FIG. 3 shows a Virtual Machine Enter/Exit Instruction Format, inaccordance with the present invention;

FIG. 4 shows a Mark I ‘Woodenman’ Construction, in accordance with thepresent invention;

FIGS. 5 and 6 show the first and second half respectively, of a Mark IIConstruction, in accordance with the present invention;

FIG. 7 shows a graphical representation of a sorting network, inaccordance with the present invention;

FIG. 8 shows a flow chart of method of performing function-indexedinterleaving, in accordance with the present invention;

FIG. 9 shows a flow chart of method of performing control-flowduplication, in accordance with the present invention;

FIG. 10 shows a flow chart of method of performing data-flowduplication, in accordance with the present invention; and

FIG. 11 shows a flow chart of method of creating ƒ_(K) segments, inaccordance with the present invention.

FIG. 12 presents a process flow diagram for implementation of the MarkII protection system of the invention;

FIG. 13 shows a graphical representation of the irregular structure ofsegment design in a Mark III implementation of the invention;

FIG. 14 shows a graphical representation of the granularity that may beachieved with T-function splitting in a Mark III implementation of theinvention;

FIG. 15 shows a graphical representation of the overall structure of aMark III implementation of the invention;

FIG. 16 shows a graphical representation of the defensive layers of aMark III implementation of the invention;

FIG. 17 shows a graphical representation of mass data encoding in animplementation of the invention;

FIGS. 18 and 19 show graphical representations of control flow encodingin an implementation of the invention;

FIG. 20 shows a graphical representation of dynamic data mangling in animplementation of the invention;

FIG. 21 shows a graphical representation of cross-linking andcross-trapping in an implementation of the invention;

FIG. 22 shows a graphical representation of context dependent coding inan implementation of the invention;

FIG. 23 presents a process flow diagram for implementation of the MarkII protection system of the invention;

FIG. 24 shows a graphical representation of a typical usage of Mass DataEncoding or Dynamic Data Mangling in an implementation of the invention.

FIG. 25 shows an exemplary block diagram setting out the primaryproblems that the embodiments of the invention seek to address;

Table 25 presents a table which categorizes software boundary problems;

FIG. 26 shows a block diagram of an exemplary software system inunprotected form, under white box protection, and protected with thesystem of the invention;

FIG. 27 shows a bar diagram contrasting the levels of protectionprovided by black box, security, white box security and protection underan exemplary embodiment of the invention;

FIG. 28 shows a process flow diagram contrasting ciphers, hashes andexemplary base functions in accordance with the present invention;

FIG. 29 shows an exemplary block diagram of how base functions of theinvention may be used to provide secure communication pipes;

FIG. 30 shows a process flow diagram for function-indexed interleavingin accordance with the present invention;

FIG. 31 presents a process flow diagram for implementation of the Mark Iprotection system of the invention;

DETAILED DESCRIPTION

Embodiments disclosed herein describe systems, techniques, and computerprogram products that may allow for securing aspects of computer systemsthat may be exposed to attackers. For example, software applicationsthat have been distributed on commodity hardware for operation by endusers may come under attack from entities that have access to the codeduring execution.

Generally, embodiments disclosed herein provide techniques to create aset of base functions, and integrate those functions with existingprogram code in ways that make it difficult or impossible for apotential attacker to isolate, distinguish, or closely examine the basefunctions and/or the existing program code. For example, processesdisclosed herein may receive existing program code, and combine basefunctions with the existing code. The base functions and existing codealso may be combined using various techniques such as fractures, dynamicdata mangling, cross-linking, and/or variable dependent coding asdisclosed herein, to further blend the base functions and existing code.The base functions and other techniques may use operations that arecomputationally similar, identical, or indistinguishable from those usedby the existing program code, which can increase the difficulty for apotential attacker to distinguish the protected code from the protectiontechniques applied. As will be described herein, this can provide afinal software product that is much more resilient to a variety ofattacks than is possible using conventional protection techniques.

As shown in FIG. 25, embodiments disclosed herein may provide solutionsfor several fundamental problems that may arise when software is to beprotected from attack, such as software boundary protection, advanceddiversity and renewability problems and protection measurabilityproblems.

Software boundary problems may be organized into five groups as shown inTable 1: skin problems, data boundaries, code boundaries, boundariesbetween protected data and protected code, and boundaries betweenprotected software and secured hardware.

TABLE 1 Bounday Problem Description Skin Data flows from unprotectedAttacks on unprotected data and computations can be Problem to protecteddomains starting points for compromising their data and Data flows fromprotected to computation counterparts in the protected domain. Theseunprotected domains problems typically are hard to solve withoutintroducing a Computation boundary trusted enabling mechanism at theboundary. between unprotected and protected domains Data Data typeboundary Current data transformation techniques are limited to Boundaryindividual data types, not multiple data types or mass data. Theboundaries among distinct protected data items stand out, permittingidentification and partitioning. Data dependence boundary Data diffusionvia existing data flow protections is limited. Original data flow andcomputational logic is exposed. Most current whitebox cryptographicweaknesses are related to both data type and data dependency boundaryproblems. Data crossing functional Data communications among functionalcomponents of boundaries an application system, whether running on thesame or different devices, or as client and server, are made vulnerablebecause the communication boundaries are clearly evident. CodeFunctional boundaries among Boundaries among functional components arestill visible Boundary protected components after protecting thosecomponents. For example, whitebox cryptography components can beidentified by their distinctive computations. In general, such protectedcomputation segments can be easily partitioned, creating vulnerabilitiesto component-based attacks such as code lifting, code replacement, codecloning, replay, code sniffing, and code spoofing. Boundaries betweeninjected Current individual protection techniques create secured codeand the protected code that is localized to particular computations.Code version of the original boundaries resulting from use of differentprotection application code techniques are not effectively glued andinterlocked. Boundary between protected data and Protected data andprotected code are not effectively protected code locked together toprevent code or data lifting attacks. Current whitebox cryptographicimplementations are vulnerable to such lifting attacks in the field.Boundary between protected software We lack effective techniques to lockprotected hardware and secured hardware and protected software to oneanother. The boundary between protected software and secure hardware isvulnerable, since data crossing the boundary is unprotected or weaklyprotected.

There are three types of “skin problems” which may be addressed byembodiments disclosed herein: data flows from unprotected to protecteddomains, data flows from protected to unprotected domains, andcomputation boundaries between unprotected and protected domains.Ultimately, data and user interaction should be performed in anunencoded form, so that the user can understand the information. In eachcase, attacks on unprotected data and computations can be the startingpoint for compromising their data and computation counterparts in theprotected domain. These problems conventionally are hard to solvewithout introducing a trusted enabling mechanism at the boundary.However, the diversity provided by embodiments disclosed herein, andencoding at the boundary itself, provides a degree of protection that isnot provided by known systems.

Data Boundaries may be categorized as one of three types: data typeboundaries, data dependency boundaries and data crossing functionalcomponent boundaries. With regard to data type boundaries, current datatransformation techniques are limited to individual data types, notmultiple data types or mass data. The boundaries among distinctprotected data items stand out, permitting identification andpartitioning. With regard to data dependency boundaries, data diffusionvia existing data flow protections is limited: original data flow andcomputational logic is exposed. Most current white box cryptographyweaknesses are related to both data type and data dependency boundaryproblems. Finally, with regard to data crossing functional componentboundaries, data communications among functional components of anapplication system, whether running on the same or different devices, oras client and server, are made vulnerable because the communicationboundaries are clearly evident. The use of base function encodings andfunction-indexed interleaving by embodiments disclosed herein mayaddress some or all of these data boundary issues because both the dataand the boundaries themselves may be obscured.

Code Boundaries may be categorized into two types: functional boundariesamong protected components, and boundaries between injected code and theprotected version of the original application code. Functionalboundaries among protected components are a weakness because boundariesamong functional components are still visible after protecting thosecomponents. That is, with white box protection, the white boxcryptographic components can generally be identified by theirdistinctive computations. In general, such protected computationsegments can be easily partitioned, creating vulnerabilities tocomponent-based attacks such as code lifting, code replacement, codecloning, replay, code sniffing, and code spoofing. Similarly, boundariesbetween injected protection code and the protected version of theoriginal application code are also generally visible. Current individualprotection techniques create secured code that is localized toparticular computations. Code boundaries resulting from use of differentprotection techniques are not effectively glued and interlocked. Incontrast, the use of base function encodings and function-indexedinterleaving by embodiments disclosed herein may address all of thesecode boundary issues, because code may be obscured and interleaved withthe protection code itself. Because basic computer processing andarithmetic functions are used for the protection code, there is nodistinctive code which the attacker will quickly identify.

The boundary between protected data and protected code presents anotherweakness which can be exploited by an attacker as current white boxtechniques do not secure the boundary between protected data andprotected code. In contrast, embodiments disclosed herein may locktogether the protected data and protected code, to prevent code or datalifting attacks. Current white box cryptography implementations arevulnerable to such lifting attacks in the field.

Similarly, the boundary between protected software and secured hardwarepresents a vulnerability as existing white box techniques do not protectthe boundary between protected software and secure hardware-datacrossing such a boundary is unprotected or weakly protected. Incontrast, embodiments disclosed herein may lock protected hardware andprotected software to one another.

There are also logistical issues associated with security, inparticular, diversity and renewability problems. Current programdiversity is limited by program constructs and structures, and bylimitations of the individual protection techniques applied. As aresult, diversified instances do not vary deeply (e.g., programstructure variation is extremely limited), and instances may besufficiently similar to permit attacks based on comparing diversifiedinstances. Current protection techniques are limited to static diversityand fixed security. In contrast, embodiments as disclosed herein mayprovide dynamic diversity which may allow for intelligent control andmanagement of the level of security provided by diversity andrenewability. As disclosed in further detail herein, resolving advanceddiversity and renewability problems may be fundamental to securitylifecycle management.

FIG. 26 shows a block diagram of an example software system protectedunder a known white box model, and under an example embodiment asdisclosed herein. The original code and data functions, modules andstorage blocks to be protected are represented by the geometric shapeslabeled F1, F2, F3, D1 and D2. Existing white box and similar protectiontechniques may be used to protect the various code and data functions,modules and storage blocks, but even in a protected form they will (atthe very least) disclose unprotected data and other information at theirboundaries. In contrast, embodiments of the present invention mayresolve these boundary problems. In some cases, once an instance of anembodiment as disclosed herein has been executed, an observer cannottell which parts are F1, F2, F3, D1, D2 and data from the originalprogram, even though the observer has access to the program and canobserve and alter its operation.

This may be accomplished, for example, by interleaving the code togetherbetween different code and data functions, modules and storage blocks,thus “gluing” these components together. With the code closely tied inthis way, true boundary protection can be provided. As described above,diversity and renewability are provided in terms of 1) much greaterflexibility being provided than past systems; 2) easy and powerfulcontrol; 3) enable dynamic diversity and security; and 4) measurable andmanageable diversity. Embodiments disclosed herein also may provide a“complexity property” of one-way bijection functions, as well as ameasurable, controllable and auditable mechanism to guarantee requiredsecurity for the user. Bijections are described in greater detailhereinafter, but in short, they are lossless pairs of functions, ƒ_(K),ƒ_(K) ⁻¹, which perform a transposition of a function, which is undonelater in the protected code. The transposition may be done in thousandsor millions of different ways, each transposition generally being donein a completely different and non-repeatable manner. Various techniquesmay be used to conceal existing programs, achieving massive multicodingof bijective functions, which are not humanly programmed, but aregenerated by random computational processes. This includes bijectivefunctions which can be used in cipher- and hash-like ways to solveboundary problems.

Embodiments disclosed herein may provide improved security and securityguarantees (i.e. validated security and validated security metrics)relative to conventional techniques. Greater diversity in time and spacethan is provided by white box cryptography also may be achieved. Thesecurity metrics are based on computational complexity of known attacks,the basic primitive being the generation of mutually inverse functionpairs. Other primitives can be constructed as described herein, with orwithout symmetric or asymmetric auxiliary keys.

FIG. 27 contrasts conventional black box and white box models withproperties of the embodiments disclosed herein, in terms of thelong-term security and resistance to hostile attacks. Cryptography islargely reliant on Ciphers and Hashes; Ciphers enable transfer ofsecrets over unsecured or public channels, while Hashes validateprovenance. These capabilities have enormous numbers of uses. In ablack-box environment, such cryptographic techniques may have very goodlong term security. However, in terms of resistance to attacks, suchsystems have a very short life. As explained above, Ciphers and Hasheshave a rigid structure and very standardized equations which arestraightforward to attack. White box protection may be used to improvethe level of resistance to attacks, but even in such an environment theprotected code will still reveal patterns and equations from theoriginal Cipher-code and Hash-code, and boundaries will not beprotected. As well, white box protection will not provide diversitywhich protects code against perturbation attacks.

In contrast, embodiments disclosed herein may incorporate Cipher-likeand Hash-like encodings, which gives the protective encodings thesecurity and strength of Ciphers and Hashes. In other words, the processof applying white box encodings to Ciphers and Hashes typically usessimple encodings in an attempt to protect and obscure very distinctivecode. The techniques disclosed herein, however, may use strong, diverseencodings to protect any code. With the diverse encodings andinterleaving as disclosed, distinctiveness in the targeted code will beremoved. Thus, as shown, the disclosed techniques may provide a muchstronger security profile than conventional black box and white boxprotection.

FIG. 1 shows a commutative diagram for an encrypted function usingencodings, in accordance with embodiments of the present invention. Fora F where F::D→R is total, a bijection d: D→D′ and a bijection r: R→R′may be selected. F′=r∘F∘d⁻¹ is an encoded version of F; d is an inputencoding or a domain, encoding and r is an output encoding or a rangeencoding. A bijection such as d or r is simply called an encoding. Inthe particular case where F is a function, the diagram shown in FIG. 1then commutes, and computation with F′ is computation with an encryptedfunction. Additional details regarding the use of such encodingsgenerally are provided in Section 2.3 of the Appendix.

FIG. 28 contrasts the properties of conventional Ciphers and Hashes withthose of the bijective base functions disclosed herein. Ciphers arenon-lossy functions; they preserve all of the information that theyencode, so the information can be unencoded and used in the same manneras the original. Ciphers are invertible provided that one is given thekey(s), but it is hard to determine the key or keys K1, K2 frominstances of plain and encrypted information (“PLAIN” and “ENCRYPTED” inFIG. 28). Hashes are lossy above a certain length, but this typically isnot a problem because hashes are generally used just for validation.With a hash it is hard to determine the optional key, K, from instancesof the original data and the hash (“PLAIN” and “HASHED” in FIG. 28).

The base functions disclosed herein may serve in place of either ciphersor hashes, as it is hard to determine the key or keys from considerationof the encoding and unencoding functions ƒ_(K), ƒ_(K) ⁻¹. The advantagethat the base functions provide over the use of Ciphers or Hashes, isthat the computations used by the base functions are more similar toordinary code, which makes it easier to blend the code of the basefunctions with the targeted code. As noted above, Ciphers and Hashes usevery distinctive code and structure which is difficult to obscure orhide, resulting in vulnerability.

Mutually-inverse base function pairs as disclosed herein may employrandom secret information (entropy) in two ways: as key information Kwhich is used to determine the mutually inverse functions ƒ_(K), ƒ_(K)⁻¹, and as randomization information R which determines how the ƒ_(K),ƒ_(K) ¹ implementations are obscured.

For example, two mutually inverse base functions may be represented bysubroutines G and H, written in C. The base functions may be constructedby an automated base function generator program or system, with G beingan obfuscated implementation of the mathematical function ƒ_(K) and Hbeing an obfuscated implementation of the mathematical function ƒ_(K)⁻¹. Thus, G can be used to ‘encrypt’ data or code, which can then be‘decrypted’ with H (or vice versa).

Optionally, run-time keys can be provided in additional to thebuild-time key K. For example, if the input of a given base function iswider than the output, the extra input vector elements can be used as arun-time key. This is much like the situation with a cipher such asAES-128. A typical run of AES-128 has two inputs: one is a 128-bit key,and one is a 128-bit text. The implementation performs encipherment ordecipherment of the text under control of the key. Similarly, abase-function can be constructed to encrypt differently depending on thecontent of its extra inputs, so that the extra inputs in effect become aruntime key (as opposed to the software generation time key Kcontrolling the static aspects of the base function). The buildingblocks of base functions disclosed herein make it relatively easy todictate whether the runtime key is the same for the implementations ofboth ƒ_(K), ƒ_(K) ⁻¹ or is different for ƒ_(K) than for ƒ_(K) ⁻¹: if theruntime key is added to the selector vector, it is the same for ƒ_(K)and ƒ_(K) ⁻¹, and if it is added elsewhere, it differs between ƒ_(K) andƒ_(K) ⁻¹.

Key information K can be used to select far more varied encodingfunctions than in known white box systems, permitting much strongerspatial and temporal diversity. Diversity is also provided with othertechniques used in embodiments of the invention such as Function-IndexedInterleaving which provides dynamic diversity via text-dependence.Further diversity may also be provided by variants of Control-FlowEncoding and Mass-Data Encoding described hereinafter.

Base functions as disclosed herein may incorporate or make use of statevector functions. In general, as used herein a state-vector function isorganized around a vector of N elements, each element of which is aw-bit quantity. The state vector function may be executed using a seriesof steps, in each of which a number between zero and N of the elementsof the vector are modified. In a step in which zero elements aremodified, the step essentially applies the identity function on thestate-vector.

In some embodiments, one or more of the state-vector functions used inconstructing a base function may be invertible. A state-vector functionis invertible if, for each and every step in the state-vector function,a step-inverse exists such that that applying the step-algorithm andthen applying the step-inverse algorithm has no net effect. Any finitesequence of invertible steps is invertible by performing theinverse-step algorithms in the reverse order of their originals.

Illustrative examples of invertible steps on a vector of w-bit elementsinclude adding two elements, such as adding i to j to obtain i+j,multiplying an element by an odd constant over Z/(2^(w)), mapping acontiguous or non-contiguous sub-vector of the elements to new values bytaking the product with an invertible matrix over Z/(2^(w)). Theassociated inverse steps for these examples are subtracting element ifrom element j, multiplying the element by the multiplicative inverse ofthe original constant multiplier over Z/(2^(w)), and mapping thesub-vector back to its original values by multiplying by the inverse ofthat matrix, respectively.

Some embodiments may use one or more state-vector functions that haveone or more indexed steps. A step is indexed if, in addition to itsnormal inputs, it takes an additional index input such that changing theindex changes the computed function. For example, the step of adding aconstant vector could be indexed by the constant vector, or the step ofpermuting a sub-vector could be indexed by the permutation applied. Ineach case, the specific function executed is determined at least in partby the index provided to the function.

Indexed steps also may be invertible. Generally, an indexed step isinvertible if it computes an invertible step for each index, and theindex used to compute the step, or information from which that index canbe derived, is available when inverting the step. For example, S₁₇ isinvertible if S₁₇ ⁻¹ is defined, and the index (17) is available at theappropriate time to ensure that it S₁₇ ⁻¹ is computed when inverting thestate-vector function. As an example, a step may operate on someelements of the state. To index this step, other elements of the statemay be used to compute the index. If invertible steps are then performedon the other elements, the index by may be retrieved by inverting thosesteps, as long as the two sets of elements do not overlap.

Function-Indexed Interleaving as disclosed herein is a specific exampleof the principle of the use of indexed steps within a base function.Other uses of indexed steps as disclosed herein may include: allowingthe creation of keyed state-vector functions: the set of indexes used insome of the indexed steps can be used as a key. In that case, the indexis not obtained from within the computation, but is provided by anadditional input; i.e., the function takes the state-vector plus the keyas an input. If the indexed steps are invertible, and the ordinary,non-indexed steps are invertible, then the whole state-vector functionis invertible, rather like a keyed cipher.

In some embodiments, the index information may provide or may serve as akey for the generated base functions. If the state-vector function ispartially evaluated with respect to the index information when thestate-vector function is generated, so that the index does not appear inthe execution of the generated function explicitly, it is ageneration-time key. If code to handle the index information isgenerated during execution of the state-vector function, so that theindex does appear in the execution of the generated function explicitly,it is a run-time key. If the code internally generates the index withinthe state-vector function, it is a function-indexed key.

In an embodiment, a base function may be constructed based upon aninitial selected or identified word-size w. In some configurations, thedefault integer size of the host platform may be used as the word sizew. For example, on modern personal computers the default integer sizetypically is 32 bits. As another example, the short integer length asused, for example, in C may be used, such as 16 bits. In otherconfigurations, a 64-bit word size may be used. A vector length N isalso selected for the base function, which represents the length ofinputs and outputs in the w-sized words, typically encompassing four ormore words internally. In some embodiments, such as where interleavingtechniques as disclosed herein are used, it may be preferred for theword size w to be twice the internal word size of the N-vector. Thestate-vector function then may be created by concatenating a series ofsteps or combinations of steps, each of which performs invertible stepson N-vectors of w-element word. The inverse of the state-vector functionmay be generated by concatenating the inverses of the steps in thereverse order.

In some embodiments, one or more keys also may be incorporated into thestate-vector function. Various types of keying may be applied to, orintegrated with, the state-vector function, including run-time keying,generation-time keying, and function-indexed keying as previouslydescribed. To generate a run-time keyed state-vector function, thefunction may be modified to receive the key explicitly as an additionalinput to the function. To generate a generation-time keyed state-vectorfunction, code in the state-vector function may be partially evaluatedwith respect to a provided key. For many types of operations, this aloneor in conjunction with typical compiler optimizations may be sufficientto make the key unrecoverable or unapparent within the generated code.To generate a function-indexed keyed state-vector function, thestate-vector function may be constructed such that appropriate keys forinverse operations are provided as needed within the state-vectorfunction.

In some embodiments, it may be preferred to select an implementation forthe state-vector function that accepts a relatively wide input andprovides a relatively wide output, and which includes a complex set ofinvertible steps. Specifically, it may be preferred to construct animplementation that accepts at least a 64-bit wide input and output. Italso may be preferred for a significant number of steps in thestate-vector function, such as at least 50% or more, to be linear oraffine operations over Z/(2^(w)). It also may be preferred to selectsteps for the state-vector function which have wide variety

In some embodiments, it may be preferred to index a significant portionof the steps, such as at least 50% or more, using multiple forms ofindexing. Suitable forms of indexing include if-then-else or switchconstructs, element-permutation selection, iteration counts, elementrotation counts, and the like. It also may be preferred for some or allof the indexes to be function-indexed keys as disclosed herein.

In some embodiments, it may be preferred for the initial and/or finalsteps of the state-vector function to be steps which mix input entropyacross the entire state-vector, typically other than any separatekey-input.

In some embodiments, it may be preferred to construct the state-vectorfunction such that at least every few steps, a non-T-function step isperformed. Referring to programming operations, examples of T-functionsteps include addition, subtraction, multiplication, bitwise AND,bitwise XOR, bitwise NOT, and the like; examples of non-T-function stepsinclude division, modulo assignment, bitwise right shift assignment, andthe like. Other examples of non-T-function steps includefunction-indexed keyed element-wise rotations, sub-vector permutations,and the like. As previously disclosed, the inclusion of non-T-functionsteps can prevent or reduce the efficacy of certain types of attacks,such as bit-slice attacks.

As previously described, a state-vector function pair includes thestate-vector function as described herein and the complete inverse ofthe state-vector function. In operation, construction of thestate-vector function pair may, but need not be performed by, forexample, combining a series of parameterized algorithms and/or inversealgorithms in the form of language source such as C++ code or the like.Similarly, substitution of generation-time keys may, but need not beperformed by a combination of macro substitution in the macropreprocessor, function in-lining, and use of parameterized templates.Such combinations, substitutions, and other operations may be automatedwithin a state-vector generating system as disclosed herein. Once thestate-vector function pair has been generated, one or both may beprotected using binary- and/or compiler-level tools to further modifythe generated code. In some embodiments, the specific modifications madeto one or both functions in the state-vector function pair may beselected based upon whether or not each member is expected to execute inan environment likely to be subject to attack.

For example, in some embodiments, the function or a part of the functionthat is expected to be in an exposed environment may be bound near apoint at which an input vector is provided to the state-vector function,and/or near the point where an output vector is consumed by its invokingcode. The code may be bound by, for example, the use of dynamic datamangling and/or fractures as disclosed herein. For example, the inputsprovided may be from a mangled store, and outputs may be fetched by aninvoker from the mangled store. Other techniques may be used to bindcode at these points, such as data-flow duplication with cross-linkingand cross-trapping as disclosed herein. Different combinations may beused, such as where dynamic data mangling, fractures, and data-flowduplication are all applied at the same point to bind the code at thatpoint. The protections applied to code expected to he in an exposedenvironment may be applied within one or both of the state-vectorfunction, with the portion of the code affected determined by the neededlevel of security. For example, applying multiple additional protectiontypes at each possible point or almost each possible point may providemaximal security; applying a single protection at multiple points, ormultiple protection types at only a single code point, may provide alower level of security but improved performance during code generationand/or execution. In some embodiments, fractures may be applied atmultiple points throughout the generation and binding process, becausemany opportunities for fracture creation may exist due to generation ofmany linear and affine operations among the steps of the state-vectorfunction during its construction.

In some embodiments, it may be useful to make one member of astate-vector function pair more compact than the other. This may bedone, for example, by making the other member of the pair more expensiveto compute. As a specific example, when one member of a state-vectorfunction pair is to be used on exposed and/or limited-power hardwaresuch as a smart card or the like, it may be preferred for ahardware-resident member of the state-vector function pair to besignificantly more compact than in other embodiments disclosed herein.To do so, a corresponding server-resident or other non-exposed member ofthe state-vector function pair may be made significantly more costly tocompute. As a specific example, rather than using a relatively highnumber of coefficients as disclosed and as would be expected for astate-vector function generation technique as disclosed previously, arepetitious algorithm may be used. The repetitious algorithm may usecoefficients supplied by a predictable stream generation process orsimilar source, such as a pseudo-random number generator that uses aseed which completely determines the generated sequence. A suitableexample of such a generator is the a pseudo-random generator based onARC4. In some embodiments, such as where the available RAM or similarmemory is relatively limited, a variant that uses a smaller element sizemay be preferred. The pseudo-random number generator may be used togenerate all matrix elements and displacement-vector elements.Appropriate constraints may be applied to ensure invertibility of theresulting function. To invert, the generated matrices can be reproducedby knowledge of the seed, at the cost of creating the complete streamused in the exposed pair member, reading it in reverse, multiplicativelyinverting each matrix, and additively inverting each vector element in adisplacement, over Z/(2^(w)). Thus, a limited-resource device such as asmart card may be adapted to execute one of a state-vector functionpair, while the system as a whole still receives at least some of thebenefits of a complete state-vector function system as disclosed herein.

Securing Communication Pipes

As shown in the block diagram of FIG. 29, base functions as disclosedherein may be used to provide a secure communication pipe from one ormore applications on one or more platforms, to one or more applicationson one or more other platforms (i.e. an e-link). The same process may beused to protect communication from one sub-application to anothersub-application on a single platform. In short, a base function pairƒ_(K), ƒ_(K-1) may be used to protect a pipe by performing a cipher-likeencrypt and decrypt at respective ends of the pipe. In an embodiment,the base function pair ƒ_(K), ƒ_(K-1) may be applied to the pipe startand pipe end, and also applied to the application and its platform, thusbinding them together and binding them to the pipe. This secures (1) theapplication to the pipe-start, (2) the pipe-start to the pipe-end, and(3) the pipe-end to the application information flow.

An illustrative way of effecting such a process is as follows. Firstly,a key K is generated using a random or pseudo-random process. Thebase-functions ƒ_(K), ƒ_(K) ⁻¹ are then generated using the key K andrandomization information R. The base functions are then applied topipe-start and pipe-end so that at run time, the pipe-start computesƒ_(K), and the pipe-end computes ƒ_(K) ⁻¹. The key K can then bediscarded as it is not required to execute the protected code. In anapplication such as this, the base-function specifications will becipher-based specifications for ƒ_(K), ƒ_(K) ⁻¹ (similar to FIPS-197 forAES encrypt and decrypt). Cloaked base-functions are specificimplementations (pipe-start and pipe-end above) of the smoothbase-functions designed to foil attempts by attackers to find K, inverta base-function (i.e., break encryption), or break any of the bindingsshown above. That is, a smooth base function is one which implementsƒ_(K) or ƒ_(K) ⁻¹ straightforwardly, with no added obfuscation. Acloaked base function still computes ƒ_(K) or ƒ_(K) ⁻¹, but it does soin a far less straightforward manner. Its implementation makes use ofthe obfuscation entropy R to find randomly chosen, hard to followtechniques for implementing ƒ_(K) or ƒ_(K) ⁻¹. Further examples oftechniques for creating and using cloaked base functions are provided infurther detail herein.

Function-Indexed Interleaving

To guard against homomorphic mapping attacks, embodiments disclosedherein may use replace matrix functions with functions which are (1)wide-input; that is, the number of bits comprising a single input islarge, so that the set of possible input values is extremely large, and(2) deeply nonlinear; that is, functions which cannot possibly beconverted into linear functions by i/o encoding (i.e., by individuallyrecoding individual inputs and individual outputs). Making the inputswide makes brute force inversion by tabulating the function over allinputs consume infeasibly vast amounts of memory, and deep nonlinearityprevents homomorphic mapping attacks.

Some embodiments may use “Function-Indexed Interleaving”, which mayprovide diffusion and/or confusion components which are deeplynonlinear. A function from vectors to vectors is deeply nonlinear if andonly if it cannot be implemented by a matrix together with arbitraryindividual input- and output-encodings. If it is not deeply nonlinear,then it is “linear up to I/O encoding” (“linearity up to I/O encoding”is a weakness exploited in the BGE attack on WhiteBox AES.)

Function-Indexed Interleaving allows conformant deeply nonlinear systemsof equations to be solved by linear-like means. It can be used to fosterdata-dependent processing, a form of dynamic diversity, in which notonly the result of a computation, but the nature of the computationitself, is dependent on the data. FIG. 30 shows a process flow diagramof an example Function-Indexed Interleaving process, which interleaves asingle 4×4 function with a family of 4×4 functions. The 1×1 functionwith 1×1 function-family case permits combining of arbitrary kinds offunctions, such as combining a cipher with itself (in the spirit of3DES) to increase key-space; combining different ciphers with oneanother; combining standard ciphers with other functions; and combininghardware and software functions into a single function.

In the example implementation shown in FIG. 30, the square boxesrepresent bijective functions, typically but not necessarily implementedby matrices. The triangle has the same inputs as the square box ittouches and is used to control a switch which selects among multipleright-side functions, with inputs and outputs interleaving left-side andright-side inputs and outputs as shown:

-   -   if the left-side box and right-side boxes are 1-to-1, so is the        whole function;    -   if the left-side box and right-side boxes are bijective, so is        the whole function;    -   if the left-side box and right-side boxes are MDS (maximum        distance separable), so is the whole function, whether bijective        or not.

If the triangle and all boxes are linear and chosen at random, then (byobservation) over 80% of the constructions are deeply nonlinear.

In an example embodiment disclosed herein, function-indexed interleavingappears four times in an ƒ_(K), ƒ_(K) ⁻¹ specification. Each time itincludes three 4×4 linear mappings for some 4×4 matrix M. Each instanceof function-indexed interleaving has a single left-side function and2⁴=16 right-side functions.

Notably, function-indexed interleaving also may be nested, such that theleft-function or right-function-family may themselves be instances offunction-indexed interleaving. In such a configuration, the result is arecursive instance of function-indexed interleaving. In general, suchinstances typically are more difficult for an attacker to understandthan non-recursive instances; that is, increasing the level of recursionin function-indexed interleaving should increase the level of obscurity.

A further example embodiment and corresponding mathematical treatment offunction-indexed interleaving is provided in Section 2.9, andspecifically in Section 2.9.2, of the Appendix, and FIG. 8.

Mark I System

Three specific example embodiments are described in detail herein,referred to as the Mark I, II and III systems. An exemplaryimplementation of the Mark I system is presented in the process flowdiagram of FIG. 31. In this example, the square boxes represent mixedBoolean arithmetic (MBA) polynomial encoded matrices. The ambiguity ofMBA polynomial data- and operation-encodings is likely to be very highand to increase rapidly with the degree of the polynomial. Each matrixis encoded independently, and the interface encodings need not match.Thus, 2×2 recodings cannot be linearly merged with predecessors andsuccessors. The central construction is function-indexed interleavingwhich causes the text processing to be text-dependent. Using simplevariants with shifts, the number of interleaved functions can be verylarge with low overhead. For example, permuting rows and columns of 4×4matrices gives 576 choices. As another example, XORing with initial andfinal constants gives a relatively very high number of choices. Initialand final recodings mix the entropy across corresponding inputs/outputsof the left fixed matrix and the right selectable matrices. Internalinput/output recodings on each matrix raise the homomorphic mapping workfactor from order 2^(3w/2) to order 2^(5w/2) allowing for full ‘birthdayparadox’ vulnerability—the work factor may be higher, but is unlikely tobe lower.

An example embodiment of a Mark I system and corresponding mathematicaltreatment is provided in Sections 3.5 and 4 of the Appendix and in FIG.4.

However, it has been found that a Mark I type implementation may havetwo weaknesses that can be exploited in some circumstances:

1) Static dependency analysis can be used to isolate the components.2) Only shift operations and comparisons in the ‘switch’ arenon-T-functions. All of the other components are T-functions andtherefore may be recursively analysable using a bit-slice attack.

T-Functions

A function f:(B^(w))^(k)→(B^(w))^(m) mapping from a k-vector of w-bitwords to an in-vector of w-bit words is a T-function if for every pairof vectors xε(B^(w))^(k), yε(B^(w))^(m):−y=ƒ(x), with x′≠x and y′=ƒ(x′),and with bits numbered from 0 to w−1 in the w-bit words, the lowestnumbered bit in an element word at which y and y′ differ is not lowerthan the lowest numbered bit in an element word at which x and x′differ.

Thus, a function which is a T-function will have the property that achange to an input element's 2^(i) bit never affects an output element's2^(j) bit when i>j. Typically, the bit-order numbering within words isconsidered to be from low-order (2⁰) to high-order (2^(w-1)) bits,regarding words as representing binary magnitudes, so this may berestated as: an output bit can only depend on input bits of the same orlower order. So it may be possible to “slice off” or ignore higher bitsand still get valid data. Some embodiments also may incorporate tens ofmillions of T-functions, in contrast to known implementations which onlyuse hundreds of T-functions. As a result, embodiments disclosed hereinmay be more resistant to bit slicing attacks and statistical attacks.

Functions composable from ̂, V, ⊕, {circle around (+)} computed overB^(w) together with +, −, × over Z/(2^(w)), so that all operationsoperate on w-bit words, are T-functions. Obscure constructions with theT-function property are vulnerable to bit-slice attacks, since it ispossible to obtain, from any T-function, another legitimate T-function,by dropping high-order bits from all words in input and output vectors.The T-function property does not hold for right bit-shifts, bitwiserotations, division operations, or remainder/modulus operations based ona divisor/modulus which is not a power of two, nor does it hold forfunctions in which conditional branches make decisions in whichhigher-order condition bits affect the value of lower-order output bits.For conditional branches and comparison-based conditional execution,conditional execution on the basis of conditions formed using any one ofthe six standard comparisons =, ≠, <, >, ≦, ≅ all can easily violate theT-function condition, and indeed, in normal code using comparison-basedbranching logic, it is easier to violate the T-function condition thanit is to conform to it.

External and Internal Vulnerabilities and Attack-Resistance

By repeatedly applying either of a pair of bijective functions ƒ_(K),ƒ_(K) ⁻¹ where ƒ_(K), ƒ_(K) ⁻¹ are T-functions, it may be possible toprecisely characterize the computations using a bit-slice attack. Insuch an attack, the operation of these functions is considered ignoringall but the low-order bits, and then the low-order two bits, and so on.This provides information until the full word size (e.g., 32 bits) isreached, at which point complete information on how the function behavesmay be available, which is tantamount to knowledge of the key K. This isan external vulnerability. While the attack gains knowledge ofimplementation details, it does so without any examination of the codeimplementing those details, and could be performed as an adaptive knownplaintext attack on a black-box implementation.

A less severe external vulnerability may exist if the functions of thepair have the property that each acts as a specific T-function onspecific domains, and the number of distinct T-functions is low. In thiscase, a statistical bucketing attack can characterize each T-function.Then if the domains can similarly be characterized, again, without anyexamination of the code, using an adaptive known plaintext attack, anattacker can fully characterize the functionality of a member of thepair, completely bypassing its protections, using only black-boxmethods. Plainly, it may be desirable to have an effective number ofdistinct T-functions to foil the above attack. In Mark III typeimplementations, for example, there are over 10⁸ distinct T-functionsper segment and over 10⁴⁰ T-functions over all. Mark III typeimplementations are described in further detail herein.

In some cases, the pair of implementations may include functions whichachieve full cascade, that is, every output depends on every input, andon average, changing one input bit changes half of the output bits. Anexample of an internal vulnerability may occur in a Mark II typeimplementation where, by ‘cutting’ the implementation at certain points,it may be possible to find a sub-implementation (a component)corresponding to a matrix such that the level of dependency is exactly2×2 (in which case the component is a mixer matrix) or 4×4 (in whichcase it is one of the L, S, or R matrices). Once these have beenisolated, properties of linear functions allow very efficientcharacterization of these matrices. This is an internal attack becauseit requires non-black-box methods: it actually requires examination ofinternals of the implementations, whether static (to determine thedependencies) or dynamic (to characterize the matrices bylinearity-based analyses).

As a general rule, the more external attacks are prevented, and apotential attacker is forced to rely on increasingly fine-grainedinternal attacks, the harder the attacker's job becomes, and mostespecially, the harder the attacks become to automate. Automated attacksare especially dangerous because they can effectively provide classcracks which allow all instances of a given technology to be broken bytools which can be widely distributed.

Thus embodiments disclosed herein may provide, by means of variable andincreasingly intricate internal structures and increasingly variegateddefenses, an environment in which any full crack of an instance requiresmany sub-cracks, the needed sub-cracks vary from instance to instance,the structure and number of the attacked components varies from instanceto instance, and the protection mechanisms employed vary from instanceto instance. In this case, automating an attack becomes a sufficientlylarge task to discourage attackers from attempting it. In thesubstantial time it would take to build such an attack tool, thedeployed protections may have been updated or otherwise may have movedon to a new technology for which the attack-tool's algorithm no longersuffices.

Mark II System

A block diagram of an example Mark II type implementation according toan embodiment is presented in FIGS. 23 and 12. FIG. 23 presents theprocessing of a “base core function” which appears four times in FIG.12. The complete execution flow for a Mark II type system is shown inFIGS. 5 and 6, and described in further detail with reference to FIGS. 5and 6 in Section 5.1 of the Appendix.

In an implementation according to a Mark II type embodiment, explicituse of recoding is part of the functionality chosen by K. Right-siderecodes and permutations are chosen text-dependently from pairs for atotal of 16 configurations per core and 65,536 configurations over all.However, a T-function count of 65,536 over all may be much too low formany cases; even a blind bit-slice attack, which ignores the internalstructure and uses statistical bucketing, might suffice to crack theMark H implementation given sufficient attack time.

The balance of a Mark II type implementation is shown in FIG. 12.Initial and final permutations and recodes as shown are staticallychosen at random. Swapping sides between cores 1 & 2 and between cores 3& 4, and half-swapping between cores 2 & 3, ensure text dependenceacross the entire text width. However, the highly regular structurefacilitates component-isolation by interior dependency analysis. Oncethe components are isolated, the T-functions can be analysed bybit-slice analysis. The non-T-function parts are simple and can becracked using straightforward attacks. Thus, the Mark II implementationis effective and is useful in many applications, but could becompromised with sufficient access and effort.

The Mark II proposal is similar to Mark I in that it has a fixedinternal structure, with only coefficient variations among the basefunction implementation pairs. Further description regarding the exampleembodiment of a Mark II implementation and a corresponding mathematicaltreatment is provided in Section 5.1 of the Appendix.

Mark III System

In contrast to the Mark I and Mark II implementations described above, aMark III base function design according to an embodiment disclosedherein may include the following properties:

-   -   an irregular and key-determined structure, so that the attacker        cannot know the details of the structure in advance;    -   highly data-dependent functionality: varying the data varies the        processing of the data, making statistical bucketing attacks        resource-intensive;    -   a relatively extremely high T-function count (the number of        separate sub-functions susceptible to a recursive bit-slice        attack), making a blind bit-slice attack on its T-functions        infeasible;    -   redundant and implicitly cross-checked data-flow, making        code-modification attacks highly resource-intensive; and    -   omni-directional obfuscation-induced dependencies, making        dependency-based analysis resource-intensive.

FIG. 13 shows a schematic representation of execution flow in a portionof an example Mark III type implementation. Similar to the exampleexecution flows described with respect to the Mark I and Mark II typeimplementations, each component may represent a function, process,algorithm or the like, with arrows representing potential executionpaths between them. Where different arrows lead to different pointswithin the components, it will be understood that different portions ofthe component may be executed, or different execution paths within thecomponent may be selected. As shown in FIG. 13, a Mark III typeimplementation may provide an irregular, key-dependent, data-dependent,dataflow-redundant, cross-linked, cross-checked, tamper-chaoticstructure, containing a nested function-indexed-interleaving within afunction-indexed interleaving. Cross-linking can be omnidirectionalbecause right-side selection depends on the inputs, not the outputs, ofthe left-side in each interleaving, so that simple code reorderingwithin each segment allows right-to-left cross connections as well asleft-to-right ones. As shown in FIG. 14, Irregular Extremelyfine-grained T-function splitting makes overall T-function partitioningattack ineffective.

FIG. 15 shows another example schematic of a portion of a Mark III typeimplementation as disclosed herein. As shown in FIG. 15, the initial andfinal mixing may use linear transforms of 32-bit words having widths of3 to 6. Five to seven segments may be are used, each of which contains a3-band recursive instance of function-indexed interleaving. Each band is3 to 6 elements wide, with a total of 12 elements for all three bands.Matrices are I/O permuted and I/O rotated, giving over 100 millionT-subfunctions per segment: the whole base function has over 10⁴⁰T-subfunctions. Dataflow duplication, random cross-connection, andrandom checks, combined with code-reordering also may be used, creatingomni-directional cross-dependencies.

A number of the different defenses that may be used in a Mark III typesystem are shown graphically in FIG. 16. They include features such asthe following:

-   -   memory-shuffling with fractured transforms (dynamic data        mangling) which hides dataflow;    -   random cross-linking, cross-trapping, and variable-dependent        coding which causes pervasive inter-dependence and chaotic        tamper response;    -   permutation polynomial encodings and function-indexed        interleaving which hobble linear attacks;    -   variable, randomly-chosen structure which hobbles        advance-knowledge attacks; and    -   functionality is highly dependent on run-time data, reducing        repeatability and hobbling statistical bucketing attacks.

Further details regarding a Mark III type implementation are provided inSection 6 of the Appendix. A related process for creating an invertiblematrix over Z/(2^(w)) is provided in Section 3.3 of the Appendix. Asshown and described, initial and/or final mixing steps also may be used,examples of which are provided in Section 2.8 of the Appendix.

By replacing conditional swaps with 2×2 bijective matrices mixing eachinput into each output, we can take precisely the same network topologyand produce a mixing network which mixes every input of a base functionwith every other initially, and we can employ another such networkfinally to mix every output of the base function with every other. Asnoted above the mixing is not entirely even, and its bias can be reducedwith conditional swaps replaced by mixing steps. A segment's input andoutput vectors also may be subdivided, for example as described infurther detail in Sections 6.2.3-6.2.7 of the Appendix, and asillustrated in FIG. 11.

Data-Flow Duplication

Some embodiments may include data flow duplication techniques. Forexample, as described below, for every instruction which is not a JUMP .. . , ENTER, or EXIT, the instruction may copied so that an originalinstruction is immediately followed by its copy, and new registers maybe chosen for all of the copied instructions such that, if x and y areinstructions, with y being the copy of x,

1) if x inputs the output of an ENTER instruction, then thecorresponding y input uses the same output;

2) if x inputs the output of an original instruction u with copy v, thenthe corresponding input of y inputs from the v output corresponding tothe u output from which x inputs; and

3) if x outputs to an EXIT instruction, then the corresponding output ofy outputs to a special unused sink node indicating that its output isdiscarded.

Thus, all of the computations except for the branches have an originaland a copy occurrence.

To accomplish this transformation, we proceed as follows.

We add a new instruction JUMPA (jump arbitrarily′), which is anunconditional branch with two destinations in control-flow graph (cfg)form, just like a conditional branch, but with no input: instead, JUMPAchooses between its two destinations at random. JUMPA is not actuallypart of the VM instruction set, and no JUMPA will occur in the finalobfuscated implementation of ƒ_(K) or ƒ_(K) ⁻¹.

We use JUMPA in the following transformation procedure:

1) If the implementation is not in SMA (static multi-assignment) formalready, convert it to SMA form;

2) For each of BB X_(i) of the BB's in the implementation X_(i), . . . ,X_(k), replace it with three BBs C_(i), X_(i), X′_(i), by creating a newBB X′_(i) which is identical to X_(i), and adding a new BBC_(i) whichcontains only a single JUMPA instruction targeting both X_(i) and X′_(i)making X_(i) and X′_(i) the two targets of C_(i)'s JUMPA, and makingevery non-JUMPA branch-target pointing to X_(i) point to C_(i) instead.

3) Convert the implementation to SSA form (static single assignment),isolating the local data-flow in each X_(i) and X′_(i) althoughcorresponding instructions in X_(i) and X′_(i) still compute identicalvalues.

4) Merge all of the code in each X′_(i) back into its X₁, alternatinginstructions from X_(i) and X′_(i) in the merge so that correspondingpairs of instructions are successive: first the X_(i) instruction, andthen the corresponding X′_(i) instruction.

5) Make each branch-target which is a C, point to the corresponding X,instead, and remove all of the C_(i) and X′_(i) BBs. At this point, thedata-flow has been duplicated, the original shape of the CFG has beenrestored, and the implementation is free of JUMPA instructions. Rememberwhich instructions correspond in each X_(i) for future use.

Further details regarding control flow duplication are provided inSection 5.2.6 of the Appendix, and described with respect to FIG. 9,which shows an example process for control flow duplication according toembodiments disclosed herein.

Fractures and Fracture Functions

Generally when an encoded output is produced, it is consumed withexactly the same encoding assumed, so that an encoded operation z=ƒ(x,y) becomes z′=ƒ′(x′, y′) where (x′, y′, z′)=(e_(x)(x), e_(y)(y),e_(z)(z)), for encodings e_(x), e_(y), e_(z), and wheref′=e_(z)∘f∘[e_(x) ⁻¹, e_(y) ⁻¹].

In some embodiments, it may be advantageous to output a value with oneencoding, and subsequently input assuming some other encoding. If x isoutput as e₁(x), and later consumed assuming encoding e₂, in effect wehave applied e₂ ⁻¹∘e₁ to the unencoded value. Such an intentionalmismatch between the encoding in which a value is produced and theencoding assumed when it is consumed is referred to herein as a“fracture.” If the encodings are linear, so is the fracture function e₂⁻¹∘e₁, and if they are permutation polynomials, so is the fracturefunction e₂ ⁻¹∘e₁.

In some embodiments, fractures may be useful in obfuscation because thecomputation which they perform effectively does not appear in theencoded code—the amount and form of code to perform a normal networkedencoding and one which adds an operation by means of a fracture isidentical, and there appears to be no obvious way to disambiguate thesecases, since encodings themselves tend to be somewhat ambiguous.

Note that the defining property of a fracture is the fracture function,for example v⁻¹∘u. Generally, there are many different choices ofconsuming encoding v and producing encoding u which produce exactly thesame fracture function. It is quite possible, for example, to have u₁, .. . , u_(k), v₁, . . . , v_(k) such that v_(i) ⁻¹∘u_(i) is the samefracture function for i=1, . . . , k. Thus, specifying the fracturefunction does not necessarily specify the producing and consumingencodings which imply it.

Data Scrambling Via Mass Data Encoding

Mass Data Encoding (MDE) is described in U.S. Pat. No. 7,350,085, thecontents of which are incorporated herein by reference. In short, MDEscrambles memory locations in a hash-like fashion, dynamically recodingmemory cells on each store and dynamically recoding and relocatingmemory cells by background processing. By mismatching fetch and storerecodings, a fetch or store can perform an add or multiply whilecontinuing to look like a simple fetch or store. This makes it hard foran attacker to disambiguate between mere obfuscation and useful work.

MDE is compiled, not just interpreted, so supporting data structures arepartially implicit and hence, well-obscured. Actual addresses are alwaysscrambled and rescrambled by background activity. As shown in FIG. 17,the code accessing the Virtual MDE memory is initially written as if itwere accessing an ordinary piece of memory. The code is then modified bythe methods described in U.S. Pat. No. 7,350,085 to employ a mappingtechnique which encodes both the data and locations in the memory. Thus,the locations accessed move around over time, and the encodings appliedto the data likewise change over time, under the feet of the runningcode. This technique of protection has substantial overhead, but itshighly dynamic nature makes it arduous for an attacker to penetrate themeaning of software which uses it. Cells are recoded when stored, andare recoded periodically by background activity. Mismatching recode onstore and corresponding recode on fetch can do a covert add or multiply(key-controllable). Fetched items are recoded, but not to smooth (i.e.,not to unencoded). Stored items are not smooth prior to store, and arerecoded on store to a dynamically chosen new cell encoding. Stored dataare meaningless without the code which accesses them. One program canhave any number of distinct, nonoverlapping MDE memories. An MDE memorycan be moved as a block from one place to another or can be transmittedfrom one program to another via a transmission medium. That is, messagesof sufficient bulk can be transmitted in MDE-memory form.

The initial state of the memory is not produced by hacker-visibleactivity, and hence conceals how its contents were derived. That is, theinitial state is especially obscure.

Control Confusion via Control Flow

Control Flow Encoding (CFE) is described in U.S. Pat. No. 6,779,114, thecontents of which are incorporated herein by reference. CFE combinescode-fragments into multi-function lumps with functionality controlledby register-switching: many-to-many mapping of functionality to codelocations; execution highly unrepeatable if external entropy available:the same original code turns into many alternative executions in CFEcode. By modifying the register-switching and dispatch code, keyinformation can control what is executed and therefore control thecomputation performed by embodiments of the invention.

Code represented by the control-flow graph of FIG. 18, where the lettersdenote code fragments, can be encoded as shown in FIG. 19. The protectedcontrol-flow encoding shows lumps created by combining pieces, executedunder the control of the dispatcher, with the ‘active’ piece(s) selectedby register switching.

CFE is compiled, not just interpreted, so supporting data structures arepartially implicit, and hence, well-obscured. Lumps combine multiplepieces; that is, they have multiple possible functionalities. When alump is executed, which piece(s) is/are active is determined by whichoperate via registers pointing to real data, not dummy data. The samepiece may occur in multiple lumps, with different data-encodings:mapping from functionalities to code-locations is many-to-many.

The dispatcher can be arranged to select pieces which embody abackground process, making it hard to distinguish background andforeground activity. Available entropy is used to determine whichalternative way of executing a sequence of pieces is employed, providingdynamic execution diversity (nonrepeating execution). As well, keyinformation can be used to influence dispatch and hence vary therepresented algorithm.

Dynamic Data Mangling

As shown in FIG. 20 re-use of M-registers may be maximized, allocatingseparate M-registers only where required, using Chaitin's graph-coloringallocation algorithm. As a result, M-registers are re-used frequently,making data-flow harder for attackers to follow.

To do so, first a modulus M, a permutation polynomial p over the mod-Mring, an input-based 1×n vector mapping matrix A yielding z from theinputs, and a series of constant c_(i)=p(z+i) for 1≦i≦M, may beselected, where the c_(i) values are distinct since p is a mod-Mperm-polynomial. Locations c₁, . . . , c_(n) (with n≦M) are treated inan array X of size M as ‘M-registers’.

During computation, data may be moved randomly into and out ofM-registers, and from M-register to M-register, changing encoding ateach move. Some embodiments also may randomly cause either the encodingsto form an unbroken sequence, or may inject fractures as disclosedherein where encodings do not match.

Given a fracture with data in encoding e1, the input is assumed to be inencoding e2, thus computing the fracture function e3=e2−1∘e1. If e1, e2are linear, so is e3. If e1, e2 are permutation polynomials, so is e3.The code has identical form whether a fracture is present or not; i.e.,it is ambiguous whether or not a fracture is present. Thus, aspreviously described, fractures may provide a means of injecting hiddencomputations such that the code looks much the same before and after itis added.

Additional details and mathematical treatment of the use of dynamic datamangling is provided in Section 7.8.14 of the Appendix.

Cross-Linking and Cross-Trapping

The generous application of cross-linking and cross-trapping can provideaggressive chaotic response to tampering and perturbation attacks, withmuch stronger transcoding and massive static analysis resistance. In anembodiment, cross-linking and cross-trapping may be effected as follows,as illustrated in FIG. 21:

1) copy computations at least once;2) randomly swap connections between the original and the copy. Becausethey are duplicates, the results will not change;3) encode all of the resulting computations so that duplicates areindependently encoded;4) randomly take duplicate results and inject computations adding theirdifference (=0) or multiplying one by the ring inverse of the other (=1)and then adding the 0 or multiplying by the 1 (in encoded form). Theinjected encoded 0-adds and 1-multiplies have no functional effectunless tampering occurs, in which case the code behaves chaotically.

An added benefit is that the static dependency graph becomes much denserthan that for the original program, making static analysis attacksdifficult. Thus, effective tampering requires that the (differentlyencoded) duplicates be correctly identified and the correct duplicatesbe changed in effectively the same way under different encodings. Thisis much harder to accomplish than ordinary tampering withoutcross-linking and cross-trapping.

An example implementation of data-flow duplication is provided inSection 5.2.8-5.2.10 of the Appendix, and illustrated in FIG. 10. Inaddition to its normal use within the entry and exit base-functions,data flow duplication and cross-checking or trapping also may beperformed using these transformations for the data-flow within thedecision-block including the transfer of information from the outputs ofthe entry base-function to inputs of the decision-block and the transferof information from the outputs of the decision-block to the inputs ofthe exit base-function.

Context-Dependent Coding

In some embodiments, the context in which base function pairs areimplemented may be an integral part of the operation of thebase-function. Context includes information from the application,hardware, and/or communication. Context of one base-function componentcan also include information from other components, which are part ofthe application in which it resides.

Referring to FIG. 22, an implementation of a base-function pair or asimilar construct may be hosted on a platform from which hardware orother platform signature constants can be derived and on which theimplementation can be made to depend. It may be preferred for theimplementation to reside in a containing application from which anapplication signature or other application constants can be derived andon which the implementation can be made to depend.

The implementation may also take inputs from which further constantsignature information can be derived and on which the implementation canbe made to depend.

Biased Permutations via Sorting Networks

Permutations may provide a basis for storing enormous numbers ofalternatives in limited space. For example, row/column permutations maybe used to turn a non-repeating 4×4 matrix into 576 non-repeating 4×4matrices. In some embodiments, the order of computations may bepermuted, deep dependence of computations on run-time data may begenerated, and the like.

Referring to FIG. 7, some embodiments may first sort, at eachcross-link, compare, and swap on greater-than. To permute, swaps areperformed with probability ½. It is easy to show that if the networksorts correctly with a compare-swap, then it permutes with random swapwith the full range of permutations as possible outputs. Someembodiments may use a recommended probability ½ Boolean generator tocompare two text-based full-range permutation polynomial encoded values.

Such sorting networks permute in a biased fashion, that is, somepermutations are more probable than others, since the number of swapconfigurations is 2^(number of stages). However, the permutation countis equal to the number of elements to permute, which does not evenlydivide the number of swap-configurations. In spite of the biased output,the advantage is simplicity and high dependency count with non-Tfunctionality.

Unbiased Permutations Via Simple Selection

In some embodiments, unbiased permutations can also be generated byselecting a 1^(st) element at random by taking the r₁ mod n elementamong the elements (zero origin), selecting 2^(nd) element at random bytaking the T₂ mod (n−1) element at random from the remaining elements,and the like. With this process each r, is a full range text-basedperm-poly value. This may provide almost perfectly bias-free andnon-T-function. However, operations may be harder to hide in orinterleave with ordinary code than for sorting-network-basedpermutation.

Hobbling Bit-Slice Analysis

As explained above, bit-slice attacks are a common attack tool:repeatedly executing a function and ignoring all but the lowest-orderbit, and then the lowest-order two bits, the three lowest-order bits,etc. This allows the attacker to gain information until the full wordsize (say 32 bits) is reached, at which point complete information hasbeen obtained on how the function behaves.

A function constructed using T-function and non-T-function componentshas subdomains over which it is a T-function embedded in an entiredomain in which the function is not. In some embodiment it may beadvantageous to make the number of such subdomains very large (forexample, in a Mark III type system as described herein, there may beover 10⁴⁰ such subdomains) to make bucketing attacks on the subdomainshighly resource-intensive. In some embodiments, liberal use also may bemade of non-T-function computations at other points, such as at decisionpoints, in permutations, in recodings, and the like.

An Example General Data Blending Mechanism

FIG. 24 shows a graphical representation of a typical usage of Mass DataEncoding or Dynamic Data Mangling as described above. If inputs to abase function are provided by such an obscured memory array, by eitherof these two techniques, and the results are also obtained by theapplication from the obscured memory array, it becomes difficult for anattacker to analyse the data-flow of information entering or leaving thebase function, making attacks on the base function more arduous.

Security-Refresh Rate

For effective application security lifecycle management, applicationstypically must be capable of resisting attacks on an ongoing basis. Aspart of this resistance, such applications may be configured toself-upgrade in response to security-refresh messages containingsecurity renewal information. Such upgrades may involve patch files,table replacements, new cryptographic keys, and other security-relatedinformation.

A viable level of security is one in which application security isrefreshed frequently enough so that the time taken to compromise aninstance's security is longer than the time to the security-refreshwhich invalidates the compromise; i.e., instances are refreshed fasterthan they can typically be broken. This is certainly achievable at veryhigh security-refresh rates. However, such frequent refresh actionsconsume bandwidth, and as we raise the refresh rate, the proportion ofbandwidth allocated to security-refresh messages increases, andavailable non-security payload bandwidth decreases.

Plainly, then, engineering the appropriate security-refresh rate isrequired for each kind of application, since the tolerable overheadsvary greatly depending on context. For example, if we expect onlygray-box attacks (neighbor side-channel attacks) in a cloud application,we would use a lower refresh rate than if we expected white-box attacks(insider attacks by malicious cloud-provider staff).

Authentication of Equality with Chaotic Failure

Suppose we have an application in which authentication is password-like:authentication succeeds where G, the supplied value, matches a referencevalue F; i.e., when G=F. Further suppose that we care about what happenswhen G=F, but if not, we only insist that whatever the authenticationauthorized is no longer feasible. That is, we succeed when G=F, but if GF, further computation may simply fail.

The authenticating equality is not affected by applying any non-lossyfunction to both sides: for any bijection φ, we can equivalently testwhether φ(φ)=φ(Γ). The authenticating equality may remain valid withhigh probability even if φ is lossy, if φ is carefully chosen so thatthe probability that φ(G)=φ(Γ) when G≠Γ is sufficiently low (as it is inUnix password authentication, for example). Based on technologypreviously described herein, we can easily perform such a test. Wepreviously described a method for foiling tampering by duplicatingdata-flow, randomly cross connecting the data-flow between duplicateinstances, and performing encoded checking to ensure that the equalitieshave not been compromised. We can adapt this approach to test whetherG=Γ, or in encoded form, whether φ(G)=φ(Γ).

We note that a data-flow yielding φ(G) already duplicates a dataflowyielding φ(Γ) along the success path where G=Γ. We therefore omit, forthis comparison, the data-flow duplication step. Then we simplycross-connect as described above and insert checks. By using thesecomputations as coefficients for future encoded computations, we ensurethat, if φ(G)=φ(Γ), all will proceed normally, but if φ(G)≠φ(Γ), whilefurther computation will proceed, the results will be chaotic and itsfunctionality will fail. Moreover, since φ is a function, if φ(G)≠φ(Γ),we can be sure that G≠Γ.

Variable-Dependent Coding

In some embodiments that incorporate operations which make use of one ormore variables which need not have a specific value during their use inthe operation, variable-dependent coding may be used to further obscurethe operation of related code. One way of doing so is to use values thatare used or generated by other operations in nearby or related sectionsof code. Thus, such values may be used repeatedly for different purposeswithin a region of code, which may make it more difficult for anattacker to discern any individual use, or to extract information aboutthe specific operations being performed in relation to those values. Forexample, if a value x is encoded as aX+b, there may be a great deal ofleeway in the specific values used for the constants a and b. In thisexample, if there are values available within the executing code thatremain constant over the life of x, they may be used as one or more ofthe constants a and/or b.

Further, for a single defined operation, different values may be usedduring each execution of the operation, such that the specific valuesused may change each time the operation is executed. This may act as anadditional barrier to a potential attacker, who may not be able to trackvalues from one execution to another as might be expected for othertypes of clear, encrypted, or obfuscated code. Continuing the exampleabove, a first operation ƒ(Y) may return values a and b and a secondoperation g(Z) may return values c and d, each of which is stored inmemory for a period of time. The variable x may be encoded during thetime that a and b are stored in memory as aX+b, and as cX+d during thetime that c and d are stored in memory. Thus, the appropriate constantswill be available via the memory to allow for decoding or otherwisemanipulating x in the appropriate encoding. The values may beoverwritten or discarded after that time, since the encoding constantsneed only be available during the time that x is used by operationswithin the executing program.

Similarly, variable values generated during execution of code may beused for other purposes in addition to or as an alternative to thefinite encoding example provided. For example, variable values may beused to select a random item from a list or index, as a seed for apseudo-random number generator, as an additive, multiplicative, or otherscaling factor, or the like. More generally, variable values generatedby one portion of executed code may be used in any place where aconstant value is needed at another portion of executed code, for aduration not more than the generated variable values are expected to beavailable.

Example Advantages

Embodiments of the invention described herein may be used to provide thefollowing, where a “sufficient period of time” may be selected based on,or otherwise determined by, the needs of security lifecycle management:

1) Black-Box Security: security as a keyed black-box cipher againstattacks up to adaptive known plaintext for a sufficient period of time;2) Secure Boundary: securely pass information in and out to/fromsurrounding code in encoded form for a sufficient period of time;3) Key-Hiding: prevent key-extraction from implementations for asufficient period of time;4) Secure Weakest-Path: cryptographically secure even on weakest datapath for a sufficient period of time;5) Anti-Partitioning: partition implementation into its constructionblocks for a sufficient period of time;6) Application-Locking: cannot extract implementation from itscontaining application for a sufficient period of time; and7) Node-Locking: cannot extract implementation from its host platformfor a sufficient period of time.

Generally, embodiments disclosed herein relate to base-functionencoding, using various techniques and systems as disclosed. Specificembodiments also may be referred to herein, such as in the Appendix, as“ClearBox” implementations.

The various techniques as disclosed herein may use operations that aresimilar in nature to those used in an application that is beingprotected by the disclosed techniques, as previously described. That is,the protection techniques such as base functions, fractures, dynamicdata mangling, cross-linking, and variable dependent coding may useoperations that are similar to those used by the original applicationcode, such that it may be difficult or impossible for a potentialattacker to distinguish between the original application code and theprotective measures disclosed herein. As a specific example, basefunctions may be constructed using operations that are the same as, orcomputationally similar to, the operations performed by the originalapplication code with which the base functions are integrated, incontrast to the distinctive functions typically employed by, forexample, known encryption techniques. Such operations and techniquesthat are difficult or impossible to distinguish may be described hereinas “computationally similar.”

A method is generally conceived to be a self-consistent sequence ofsteps leading to a desired result. These steps require physicalmanipulations of physical quantities. Usually, though not necessarily,these quantities take the form of electrical or magnetic signals capableof being stored, transferred, combined, compared, and otherwisemanipulated. It is convenient at times, principally for reasons ofcommon usage, to refer to these signals as bits, values, parameters,items, elements, objects, symbols, characters, terms, numbers, or thelike. It should be noted, however, that all of these terms and similarterms are to be associated with the appropriate physical quantities andare merely convenient labels applied to these quantities. Thedescription of the present invention has been presented for purposes ofillustration but is not intended to be exhaustive or limited to thedisclosed embodiments. Many modifications and variations will beapparent to those of ordinary skill in the art. The embodiments werechosen to explain the principles of the invention and its practicalapplications and to enable others of ordinary skill in the art tounderstand the invention in order to implement various embodiments withvarious modifications as might be suited to other contemplated uses.

Embodiments disclosed herein may be implemented in and used with avariety of computer systems and architectures. FIG. 32 is an examplecomputer system 3200 suitable for implementing embodiments disclosedherein. The computer 3200 may include a communication bus 3201 whichinterconnects major components of the system, such as a centralprocessor 3210; a fixed storage 3240, such as a hard drive, flashstorage, SAN device, or the like; a memory 3220; an input/output module3230, such as a display screen connected via a display adapter, and/orone or more controllers and associated user input devices such as akeyboard, mouse, and the like; and a network interface 3250, such as anEthernet or similar interface to allow communication with one or moreother computer systems.

As will be readily understood by one of skill in the art, the bus 3201allows data communication between the central processor 3210 othercomponents. Applications resident with the computer 3200 generally maybe stored on and accessed via a computer readable medium, such as thestorage 3240 or other local or remote storage device. Generally, eachmodule shown may be integral with the computer or may be separate andaccessed through other interfaces. For example, the storage 3240 may belocal storage such as a hard drive, or remote storage such as anetwork-attached storage device.

Many other devices or components may be connected in a similar manner.Conversely, all of the components shown need not be present to practiceembodiments disclosed herein. The components can be interconnected indifferent ways from that shown. The operation of a computer such as thatshown is readily known in the art and is not discussed in detail in thisapplication. Code to implement embodiments of the present disclosure maybe stored in a computer-readable storage medium such as one or more ofthe memory 3220, the storage 3240, or combinations thereof.

More generally, various embodiments disclosed herein may include or beembodied in the form of computer-implemented processes and apparatusesfor practicing those processes. Embodiments also may be embodied in theform of a computer program product having computer program codecontaining instructions embodied in non-transitory and/or tangiblemedia, such as floppy diskettes, CD-ROMs, hard drives, USB (universalserial bus) drives, or any other machine readable storage medium. Whensuch computer program code is loaded into and executed by a computer,the computer may become an apparatus for practicing embodimentsdisclosed herein. Embodiments also may be embodied in the form ofcomputer program code, for example, whether stored in a storage medium,loaded into and/or executed by a computer, or transmitted over sometransmission medium, such as over electrical wiring or cabling, throughfiber optics, or via electromagnetic radiation, wherein when thecomputer program code is loaded into and executed by a computer, thecomputer becomes an apparatus for practicing embodiments disclosedherein. When implemented on a general-purpose processor, the computerprogram code may configure the processor to create specific logiccircuits. In some configurations, a set of computer-readableinstructions stored on a computer-readable storage medium may beimplemented by a general-purpose processor, which may transform thegeneral-purpose processor or a device containing the general-purposeprocessor into a special-purpose device configured to implement or carryout the instructions. Embodiments may be implemented using hardware thatmay include a processor, such as a general purpose microprocessor and/oran Application Specific Integrated Circuit (ASIC) that embodies all orpart of the techniques according to embodiments of the disclosed subjectmatter in hardware and/or firmware.

In some embodiments, the various features and functions disclosed hereinmay be implemented by one or more modules within a computer system,and/or within software executed by the computer system. For example, acomputer system according to some embodiments disclosed herein mayinclude one or more modules configured to receive existing computerexecutable code, to modify the code as disclosed herein, and to outputthe modified code. Each module may include one or more sub-modules, suchas where a module configured to modify existing computer executable codeincludes one or more modules to generate base functions, blend the basefunctions with the code, and output the blended code. Similarly, othermodules may be used to implement other functions disclosed herein. Eachmodule may be configured to perform a single function, or a module mayperform multiple functions. Similarly, each function may be implementedby one or more modules operating individually or in coordination.

One or more currently preferred embodiments have been described by wayof example. It will be apparent to persons skilled in the art that anumber of variations and modifications can be made without departingfrom the scope of the invention as defined in the claims.

1. A method, implemented by one or more processors, comprising:duplicating a first operation of a plurality of operations to beexecuted by a computer system during execution of a program to create afirst operation copy, the plurality of operations comprising a prioroperation to be executed before the first operation and a subsequentoperation to be executed after the first operation; and modifying theprogram to execute the first operation copy subsequent to the prioroperation and prior to the subsequent operation, instead of the firstoperation; wherein a result of executing the first operation copy isequivalent to a result of executing the first operation.
 2. The methodof claim 1, further comprising: duplicating each of a plurality ofoperations to be executed by the computer system during execution of theprogram to create a corresponding operation copy; and for operation ofthe plurality of operations, randomly selecting between leaving theprogram unmodified to execute the operation, and modifying the programto execute the operation copy instead of the operation.
 3. The method ofclaim 2, further comprising: encoding each of an operation and thecorresponding operation copy using a different encoding.
 4. The methodclaim 1, further comprising: randomly selecting one or more pairs, eachpair comprising of an operation and a corresponding operation copy; andmodifying the program to add the difference between a result of theoperation and a result of the operation copy to the result obtained whenthe operation or the operation copy is executed.
 5. The method of claim1, further comprising: multiplying the result of the operation by theinverse of the result of the operation copy to obtain a check value; andmultiplying the result of execution of either the first copy or thesecond copy by the check value.
 6. The method of claim 1, wherein eachof the plurality of operations is located in a code segment selectedfrom the group consisting of: a base function; and an operation in anexisting computer-executable program.
 7. The method of claim 1, furthercomprising: modifying the program to apply multiple encodings to a valueassociated with the first operation to create a fracture.
 8. A method,implemented by one or more processors, comprising: during execution of aprogram by the one or more a processors, the program comprising aplurality operations performed during execution of the program, eachoperation having a first copy and a second copy, upon reaching anexecution point at which an operation of the plurality of operationsshould be performed, randomly executing either the first copy or thesecond copy of the operation; wherein the result of executing theplurality of randomly selected operations is equivalent to a result ofexecuting only the first copies of the plurality of operations.
 9. Themethod of claim 8, wherein each first copy of each operation is encodedusing a different encoding than the corresponding second copy of theoperation.
 10. The method of claim 8, further comprising: adding thedifference between a result of the first copy of a first operation ofthe plurality of operations and a result of the second copy of the firstoperation to the result obtained when either the first copy or thesecond copy is executed.
 11. The method of claim 8, further comprising:multiplying the result of execution of the first copy by the inverse ofthe result of the second copy to obtain a check value; and multiplyingthe result of execution of either the first copy or the second copy bythe check value.
 12. The method of claim 8, further comprising applyingmultiple encodings to a value associated with the first operation tocreate a fracture.
 13. A system comprising: one or more processors; anda computer-readable storage medium storing instructions which cause theone or more processors to: duplicate a first operation of a plurality ofoperations to be executed by a computer system during execution of aprogram to create a first operation copy, the plurality of operationscomprising a prior operation to be executed before the first operationand a subsequent operation to be executed after the first operation; andmodify the program to execute the first operation copy subsequent to theprior operation and prior to the subsequent operation, instead of thefirst operation; wherein a result of executing the first operation copyis equivalent to a result of executing the first operation.
 14. A systemcomprising: one or more processors; and a computer-readable storagemedium storing a program comprising a plurality operations forperformance by the one or more processors during execution of theprogram, each operation having a first copy and a second copy, thesystem being arranged so that, during execution of the program by theone or more processor, upon reaching an execution point at which anoperation of the plurality of operations should be performed, the one ormore processors randomly execute either the first copy or the secondcopy of the operation; wherein the result of executing the plurality ofrandomly selected operations is equivalent to a result of executing onlythe first copies of the plurality of operations.